<template>
  <el-dialog
    title="修改预约时段状态"
    :visible.sync="dialogVisible"
    :destroy-on-close="true"
    width="500px">
    <div>
      <el-form
        ref="formdata"
        :inline="true"
        :model="formdata"
        class="ky-form-inline ky-form-inline-sm">
        <el-form-item label="时段状态">
          <el-select size="mini" v-model="formdata.appointmentStatus" placeholder="请选择">
            <el-option
              v-for="item in appointmentStatusOptions"
              :key="item"
              :label="item"
              :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <slot name="condition"></slot>
        <slot name="tips"></slot>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">取消</el-button>
      <el-button size="small" type="primary" @click="eidtSend">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { Options } from '@/utils/constant'
export default {
  props: {
    asEditDialog: Boolean,
    appoStatus: String
  },
  data() {
    return {
      formdata: {
        appointmentStatus: '计划排班'
      },
      appointmentStatusOptions: Options.appointmentStatusOptions
    }
  },
  computed: {
    dialogVisible: {
      get() {
        return this.asEditDialog
      },
      set(val) {
        this.$emit('update:asEditDialog', val)
      }
    }
  },
  watch: {
    appoStatus(val) {
      if (val) {
        this.formdata.appointmentStatus = val
      }
    }
  },
  methods: {
    eidtSend() {
      this.$emit('appoStatusEidtCb', this.formdata.appointmentStatus)
    }
  }
}
</script>

<style>

</style>
